package com.example.friend.controller;


import com.example.core.controller.BaseController;
import com.example.core.entity.PageDataInfo;
import com.example.core.result.Res;
import com.example.friend.entity.DTO.QuestionQueryDTO;
import com.example.friend.entity.VO.QuestionDetailVO;
import com.example.friend.entity.VO.QuestionVO;
import com.example.friend.service.IQuestionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/question")
public class QuestionController extends BaseController {
    @Autowired
    private IQuestionService questionService;

    @GetMapping("/semiLogin/list")
    public PageDataInfo<QuestionVO> list(QuestionQueryDTO questionQueryDTO) {
        return questionService.list(questionQueryDTO);
    }

    @GetMapping("/detail")
    public Res<QuestionDetailVO> detail(Long questionId) {
        return Res.ok(questionService.detail(questionId));
    }

    @GetMapping("/preQuestion")
    public Res<String> preQuestion(Long questionId) {
        return Res.ok(questionService.preQuestion(questionId));
    }

    @GetMapping("/nextQuestion")
    public Res<String> nextQuestion(Long questionId) {
        return Res.ok(questionService.nextQuestion(questionId));
    }


}
